package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerBusinessTripApplicationMapper;
import com.traffic.domain.PerBusinessTripApplication;
import com.traffic.service.IPerBusinessTripApplicationService;

/**
 * 出差申请Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerBusinessTripApplicationServiceImpl implements IPerBusinessTripApplicationService 
{
    @Autowired
    private PerBusinessTripApplicationMapper perBusinessTripApplicationMapper;

    /**
     * 查询出差申请
     * 
     * @param tripId 出差申请主键
     * @return 出差申请
     */
    @Override
    public PerBusinessTripApplication selectPerBusinessTripApplicationByTripId(Long tripId)
    {
        return perBusinessTripApplicationMapper.selectPerBusinessTripApplicationByTripId(tripId);
    }

    /**
     * 查询出差申请列表
     * 
     * @param perBusinessTripApplication 出差申请
     * @return 出差申请
     */
    @Override
    public List<PerBusinessTripApplication> selectPerBusinessTripApplicationList(PerBusinessTripApplication perBusinessTripApplication)
    {
        return perBusinessTripApplicationMapper.selectPerBusinessTripApplicationList(perBusinessTripApplication);
    }

    /**
     * 新增出差申请
     * 
     * @param perBusinessTripApplication 出差申请
     * @return 结果
     */
    @Override
    public int insertPerBusinessTripApplication(PerBusinessTripApplication perBusinessTripApplication)
    {
        return perBusinessTripApplicationMapper.insertPerBusinessTripApplication(perBusinessTripApplication);
    }

    /**
     * 修改出差申请
     * 
     * @param perBusinessTripApplication 出差申请
     * @return 结果
     */
    @Override
    public int updatePerBusinessTripApplication(PerBusinessTripApplication perBusinessTripApplication)
    {
        perBusinessTripApplication.setUpdateTime(DateUtils.getNowDate());
        return perBusinessTripApplicationMapper.updatePerBusinessTripApplication(perBusinessTripApplication);
    }

    /**
     * 批量删除出差申请
     * 
     * @param tripIds 需要删除的出差申请主键
     * @return 结果
     */
    @Override
    public int deletePerBusinessTripApplicationByTripIds(Long[] tripIds)
    {
        return perBusinessTripApplicationMapper.deletePerBusinessTripApplicationByTripIds(tripIds);
    }

    /**
     * 删除出差申请信息
     * 
     * @param tripId 出差申请主键
     * @return 结果
     */
    @Override
    public int deletePerBusinessTripApplicationByTripId(Long tripId)
    {
        return perBusinessTripApplicationMapper.deletePerBusinessTripApplicationByTripId(tripId);
    }
}
